/* 组件样式文件 - 专业版选股系统组件样式 */

/* ============================================================================ 
   按钮组件
   ============================================================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875em;
}

/* ============================================================================ 
   表单组件
   ============================================================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-control-lg {
    padding: 16px 20px;
    font-size: 1.125rem;
    border-radius: 12px;
}

/* 日期输入框样式 */
input[type="date"] {
    position: relative;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="date"]::-webkit-datetime-edit {
    padding: 0;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

input[type="date"]::-webkit-datetime-edit-text {
    padding: 0 2px;
}

input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    padding: 0 2px;
}

input[type="date"]:hover {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.9);
}

input[type="date"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

/* 表单帮助文本样式 */
.form-help {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 6px;
    font-size: 0.85em;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-help i {
    color: #ffc107;
    font-size: 0.9em;
}

/* ============================================================================ 
   表格组件
   ============================================================================ */

/* 基础表格样式 */
.results-table {
    width: 100%;
    border-collapse: collapse;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.results-table thead {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table th {
    padding: 16px 14px;
    text-align: left;
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.results-table td {
    padding: 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95em;
}

.results-table tbody {
    flex: 1;
    overflow-y: auto;
}

.results-table tbody tr {
    transition: all 0.2s ease;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

/* 收益分析表格基础样式 */
.performance-table {
    width: 100%;
    border-collapse: collapse;
    display: table;
}

.performance-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.performance-table th {
    padding: 14px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
    background: #f8f9fa;
}

.performance-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    font-weight: normal;
    vertical-align: middle;
}

.performance-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.performance-table tbody tr:hover {
    background: #f8f9fa;
}

.performance-table tbody tr:last-child td {
    border-bottom: none;
}

/* 高级表格样式 */
.advanced-results-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.advanced-results-table thead {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    position: sticky;
    top: 0;
    z-index: 10;
}

.advanced-results-table th {
    padding: 16px 14px;
    text-align: left;
    font-weight: 700;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background: white;
}

.advanced-results-table td {
    padding: 14px;
    border-bottom: 1px solid #f8f9fa;
    color: #495057;
    font-weight: 500;
    vertical-align: middle;
}

.advanced-results-table tbody {
    flex: 1;
    overflow-y: auto;
}

.advanced-results-table tbody tr {
    transition: all 0.2s ease;
}

.advanced-results-table tbody tr:hover {
    background: #f8f9fa;
}

.advanced-results-table tbody tr:last-child td {
    border-bottom: none;
}

/* 收益分析表格样式 */
.performance-table {
    table-layout: fixed;
}

.performance-table th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 16px 14px;
    text-align: left;
    font-weight: 700;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.performance-table td {
    padding: 14px;
    border-bottom: 1px solid #f8f9fa;
    color: #495057;
    font-weight: 500;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.performance-table tbody tr {
    transition: all 0.2s ease;
}

.performance-table tbody tr:hover {
    background: #f8f9fa;
}

.performance-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格容器样式 */
.table-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f8f9fa;
    min-height: 0;
}

.advanced-table-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f8f9fa;
}

.performance-table-container {
    flex: 1;
    overflow: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f8f9fa;
    min-height: 0;
}

/* ============================================================================ 
   徽章和标签组件
   ============================================================================ */

.badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
}

.badge-primary {
    background-color: #3b82f6;
    color: white;
}

/* 文件类型标签样式 */
.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

.type-hsnapshot {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.type-block {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.type-blockinfo {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.type-fboard {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.type-unknown {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* 状态徽章样式 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.status-badge.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.status-badge.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.status-badge i {
    font-size: 0.9em;
}

/* ============================================================================ 
   消息提示组件
   ============================================================================ */

.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border-left: 4px solid #28a745;
}

.message.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

.message.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-left: 4px solid #f59e0b;
}

/* 执行状态提示样式 */
.execution-status {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid;
    animation: slideInDown 0.3s ease;
}

.execution-status.info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.3);
}

.execution-status.success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.3);
}

.execution-status.warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.1));
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.3);
}

.execution-status.error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(200, 35, 51, 0.1));
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.3);
}

.execution-status i {
    font-size: 1.2em;
}

/* ============================================================================ 
   统计卡片组件
   ============================================================================ */

.stat-card {
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 收益分析统计卡片样式 */
.performance-stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.performance-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.performance-stat-card:hover::before {
    transform: translateX(100%);
}

.performance-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.performance-stat-card .stat-value {
    font-size: 2em;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1;
}

.performance-stat-card .stat-label {
    font-size: 0.9em;
    opacity: 0.95;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* 统计卡片状态样式 */
.stat-card.warning .stat-value {
    color: #ffc107;
}

.stat-card.warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.stat-card.warning:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.2);
}

/* ============================================================================ 
   策略选择组件
   ============================================================================ */

.strategy-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.strategy-count {
    font-size: 0.9em;
    color: #667eea;
    font-weight: 600;
}

.strategy-search {
    margin-bottom: 10px;
}

.strategy-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.strategy-list::-webkit-scrollbar {
    width: 8px;
}

.strategy-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.strategy-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.strategy-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.strategy-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strategy-item:hover {
    background: rgba(102, 126, 234, 0.08);
}

.strategy-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.strategy-item label {
    cursor: pointer;
    font-size: 0.95em;
    flex: 1;
}

/* 缓存选项 */
.cache-section {
    margin-top: 10px;
}

.cache-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.cache-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 策略说明面板 */
.strategy-info-panel {
    display: flex;
    flex-direction: column;
}

.strategy-info-content {
    line-height: 1.8;
    color: #555;
}

.strategy-info-content p {
    margin-bottom: 15px;
}

/* 策略信息内容 - 优化版 */
.strategy-info-content {
    margin-top: 20px;
    line-height: 1.7;
    color: #495057;
    font-size: 0.95em;
}

.strategy-info-content p {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.strategy-info-content p:last-child {
    margin-bottom: 0;
}

.cache-info-section {
    margin-top: 20px;
    padding: 16px;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.cache-info-section h4 {
    color: #28a745;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cache-info-section p {
    background: transparent;
    border-left: none;
    padding: 8px 0;
    margin-bottom: 8px;
    color: #495057;
}

.cache-info-section p:last-child {
    margin-bottom: 0;
}
